#include<iostream>

#include<string>

using namespace std;

struct Date{//年月日

    int year;

    int month;

    int day;

    Date(int y=0,int m=0,int d=0){year=y;month=m;day=d;}

    ~Date(){}

};

struct Time{//时分秒

    int hour;

    int minute;

    int second;

    Time(int h=0,int m=0,int s=0){hour=h;minute=m;second=s;}

    ~Time(){}

};

class Publication{

private:

    string title;//出版物的标题title

    string name;//出版物的名称name

    float price;//出版物的单价price

    Date date; //出版日期date

public:

    Publication(string t="",string n="",float p=0,int h=0,int m=0,int s=0):date(h,m,s){

        title=t;name=n;price=p;}

    ~Publication(){}

    void inputdata(){

        cin>>title;

        cin>>name;

        cin>>price;

        cin>>date.year>>date.month>>date.day;

    }

    void display(){

        cout<<"*****display*****"<<endl;

        cout<<"title:"<<title<<endl;

        cout<<"name:"<<name<<endl;

        cout<<"price:"<<price<<endl;

        cout<<"year-month-day:"<<date.year<<"-"<<date.month<<"-"<<date.day<<endl;

    }

};

//你的代码将被嵌在这里

class Book:public Publication
{
private:
    int page;
public:
    Book(string a,string b,float c,int d,int e,int f,int g): Publication(a,b,c,d,e,f),page(g)
    {}
    Book():Publication(),page(0){}
    ~Book()= default;
    void inputdata()
    {
        Publication::inputdata();
        cin>>page;
    }
    void display()
    {
        Publication::display();
        cout<<"pages:"<<page<<endl;
    }
};

class CD:public Publication
{
private:
    float playtime_h,playtime_m,playtime_s;
public:
    CD(float h,float m,float s,string a,string b,float c,int d,int e,int f): Publication(a,b,c,d,e,f),playtime_h(h),playtime_m(m),playtime_s(s)
    {}
    CD():Publication(),playtime_h(0),playtime_s(0),playtime_m(0){}
    ~CD()= default;
    void inputdata()
    {
        cin>>playtime_h>>playtime_m>>playtime_s;
        Publication::inputdata();
    }
    void display()
    {
        Publication::display();
        cout<<"playtime(h:m:s) "<<playtime_h<<":"<<playtime_m<<":"<<playtime_s<<endl;
    }
};

int main()

{

    Book b;

    CD c(1,2,3,"郎朗","肖邦钢琴协奏曲",61,2018,8,1);

    b.inputdata();

    b.display();

    c.display();

    return 0;

}

